package util

import (
	"os"
	"strings"
)

func IsPathExist(path string) bool {
	_, err := os.Stat(path)
	return err == nil || os.IsExist(err)
}

// https://i.loli.net/2020/07/28/q74soVAQbl5NyK6.jpg，返回 q74soVAQbl5NyK6.jpg
func GetFileSuffix(fileName string) string {
	index := strings.LastIndex(fileName, "/")
	fileName = fileName[index+1:]
	return fileName
}
